#pragma once 

#include <string>
#include <fstream>

#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alut.h>

struct AudioObjectAtttributes {

    float position [2];
    float velocity [2];
    float orientation [5];
};

struct Listener {
    AudioObjectAtttributes attributes;
};

struct Source {
    AudioObjectAtttributes attributes;
    ALuint buffer;
    ALuint source;
    
    ALsizei size, freq;
    ALenum format;
    ALvoid *data;
    ALboolean loop = AL_FALSE;
    ALenum state;
};


class Asound {
public:
    Asound ( std::string filename, Source&, Listener& );
    
    void play ();
    void pause ();
    
    ~Asound ();
private:
    
    ALCdevice *device;
    ALCcontext *context;
    
    Listener* listener;
    Source* source;
};
